-- GENERATED SPELL FOR [Shadow Pillager] --


function spell0_16540(pUnit, Event) --@Curse of Agony,n/a--
pUnit:FullCastSpellOnTarget(29930,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16540', 30000, 1)
end

function spell1_16540(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(29928,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16540', 23000, 1)
end

function spell2_16540(pUnit, Event) --@Searing Pain,n/a--
pUnit:FullCastSpellOnTarget(29492,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16540', 1500, 1)
end

function Sorts_16540(pUnit, Event)
local choix_sorts_16540 = math.random(0, 2)
if choix_sorts_16540 == 0 then
pUnit:RegisterEvent('spell0_16540', 1, 1)
end
if choix_sorts_16540 == 1 then
pUnit:RegisterEvent('spell1_16540', 1, 1)
end
if choix_sorts_16540 == 2 then
pUnit:RegisterEvent('spell2_16540', 1, 1)
end
end

function mob16540_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16540', math.random(1500, 3000), 1)
end

function mob16540_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16540_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16540_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16540, 1, 'mob16540_Action')
RegisterUnitEvent(16540, 2, 'mob16540_Leave')
RegisterUnitEvent(16540, 3, 'mob16540_Kill')
RegisterUnitEvent(16540, 4, 'mob16540_Die')
